var html = `<div style="height: 53px">
          <div class="weui-tabbar">
	      <a href="../app/index.html" class="weui-tabbar__item">
	        <div class="weui-tabbar__icon">
	         <img src="../static/images/shouye.png" alt="">
	        </div>
	        <p class="weui-tabbar__label">首页</p>
	      </a>
	      <a href="../app/classification.html" class="weui-tabbar__item">
	        <div class="weui-tabbar__icon">
	          <img src="../static/images/jiedan.png" alt="">
	        </div>
	        <p class="weui-tabbar__label">分类</p>
	      </a>
	      <a href="../app/the_shopping_cart.html" class="weui-tabbar__item">
	        <div class="weui-tabbar__icon">
	          <img src="../static/images/qudao.png" alt="">
	        </div>
	        <p class="weui-tabbar__label">购物车</p>
	    </a>
	      <a href="../app/my.html" class="weui-tabbar__item">
	        <div class="weui-tabbar__icon">
	          <img src="../static/images/wode.png" alt="">
	        </div>
	        <p class="weui-tabbar__label">我的</p>
	  	  </a>
	  	  </div>
</div>`;

$(function() {
	$("body").append(html);
	var val = $(".tabShow").val()
	//改变字体样式
	$(".weui-tabbar__item:eq(" + val + ")").addClass("tab_active");
	//获取icon路径并改变
	var src = $(".weui-tabbar__item:eq(" + val + ") img").attr("src");
	var src1 = src.slice(0, -4);
	$(".weui-tabbar__item:eq(" + val + ") img").attr("src", src1 + "1.png");
	console.log('图片路径',src1)
	$(".weui-tabbar").on("tap", "a", function() { //点击触发跳转
		location.href = $(this).attr("href");
	});
})
